package com.ruoyi.tws.job;

import com.ruoyi.tws.service.IDriverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 定时任务
 */
@EnableScheduling
@Component
public class Tasks {

    @Autowired
    private IDriverService driverService;

    /**
     * 监测司机驾照到期
     */
    @Scheduled(cron="0 0 9 * * ?") // 每天9点运行一次
    public void driverExpires() {
        driverService.paperExpires();
    }

}
